class Solution
{
public:
    int minimumSum(int n, int k)
    {
        unordered_set<int> banned;
        int sum = 0;
        int i = 1;
        while (n > 0)
        {
            if (!banned.count(i))
            {
                sum += i;
                n--;
                banned.insert(k - i);
            }
            i++;
        }
        return sum;
    }
};